<el-dialog :close-on-click-modal="false"  :close-on-press-escape="false"  class="dialogStyleBase" :title="mixinEdit_editTitle" width="900px" :visible.sync="mixinEdit_editVisible"
    :before-close="function(){mixinEdit_editBoxClose('editForm')}" append-to-body>
    <div class="dialogStyleBaseBox" v-loading="mixinEdit_loading">
        <el-form ref="editForm" :model="form" label-width="100px" label-position="left">

            <LayoutCell>
                <LayoutCellItem title="开店会员">
                    <el-form-item label="会员ID" prop="member_id">
                        <!-- <el-input style="width:50%;margin-right:10px" v-model="form.member_id" maxlength="20"
                            show-word-limit></el-input> -->
                        <!-- <el-button @click="selectMembers">选择会员</el-button> -->
                        <SelectDataUsers v-model="usersIds" :appWindow="appWindow" :count="1" :disabled="mixinEdit_editType == 'update'"
                            :apiConfig="$vFN.Tools.getAppGlobalData('componentsApiConfig.SelectDataUsers', appWindow)"></SelectDataUsers>
                    </el-form-item>
                </LayoutCellItem>
                <!-- 基本信息 -->
                <LayoutCellItem title="基本信息">
                    <el-form-item label="门店分类" :rules="{ required: true, message: '门店分类 不能为空'}">
                        <el-button @click="storeClass()">选分类</el-button> {{ item }}
                    </el-form-item>
                    <el-form-item label="门店名称" prop="name" :rules="{ required: true, message: '门店名称 不能为空'}">
                        <el-input v-model="form.name"></el-input>
                    </el-form-item>
                </LayoutCellItem>
                <!-- 门店认证 -->
                <LayoutCellItem title="门店认证">

                    <el-form-item label="营业执照" prop="license_img" :rules="{ required: true, message: '营业执照 不能为空'}">
                        <!-- 图片 license_img -->
                        <SelectImageRadio v-model="form.license_img" :appWindow="appWindow"
                            :apiConfig="$vFN.Tools.getAppGlobalData('selectResourcesImageApiConfig.resourcesImageBox', appWindow)">
                        </SelectImageRadio>
                    </el-form-item>

                    <el-form-item label="店主身份证" prop="id_card_front_img"
                        :rules="{ required: true, message: '店主身份证 不能为空'}">
                        <el-col :span="10">
                            <SelectImageRadio v-model="form.id_card_front_img" :appWindow="appWindow"
                                :apiConfig="$vFN.Tools.getAppGlobalData('selectResourcesImageApiConfig.resourcesImageBox', appWindow)">
                            </SelectImageRadio>
                        </el-col>
                    </el-form-item>
                    <el-form-item label="店主身份证" prop="id_card_back_img"
                        :rules="{ required: true, message: '店主身份证 不能为空'}">
                        <el-col :span="10">
                            <SelectImageRadio v-model="form.id_card_back_img" :appWindow="appWindow"
                                :apiConfig="$vFN.Tools.getAppGlobalData('selectResourcesImageApiConfig.resourcesImageBox', appWindow)">
                            </SelectImageRadio>
                        </el-col>
                    </el-form-item>

                </LayoutCellItem>
                <!-- 门店介绍 -->
                <LayoutCellItem title="门店介绍">
                    <el-form-item label="logo" prop="logo_img" :rules="{ required: true, message: 'logo 不能为空'}">
                        <SelectImageRadio v-model="form.logo_img" :appWindow="appWindow"
                            :apiConfig="$vFN.Tools.getAppGlobalData('selectResourcesImageApiConfig.resourcesImageBox', appWindow)">
                        </SelectImageRadio>
                    </el-form-item>
                    <el-form-item label="店面图" prop="image_list">
                        <SelectImageCheckbox v-model="form.image_list" :count="6" :appWindow="appWindow"
                            :apiConfig="$vFN.Tools.getAppGlobalData('selectResourcesImageApiConfig.resourcesImageBox', appWindow)">
                        </SelectImageCheckbox>
                    </el-form-item>
                    <el-form-item label="背景图" prop="bg_img" :rules="{ required: true, message: '背景图 不能为空'}">
                        <SelectImageRadio v-model="form.bg_img" :appWindow="appWindow"
                            :apiConfig="$vFN.Tools.getAppGlobalData('selectResourcesImageApiConfig.resourcesImageBox', appWindow)">
                        </SelectImageRadio>
                    </el-form-item>
                    <el-form-item label="门店介绍" prop="content">
                        <el-input v-model="form.content" type="textarea" :rows="5"></el-input>
                    </el-form-item>
                </LayoutCellItem>
                <!-- 门店信息 -->
                <LayoutCellItem title="门店信息">
                    <el-form-item label="店长姓名" prop="manage" :rules="{ required: true, message: '店长姓名 不能为空'}">
                        <el-input v-model="form.manage"></el-input>
                    </el-form-item>
                    <el-form-item label="联系电话" prop="mobile"
                        :rules="[{trigger: ['blur', 'change'] ,validator: $vFN.Tools.validatePhone}]">
                        <el-input v-model="form.mobile" maxlength="11" show-word-limit></el-input>
                    </el-form-item>
                    <el-form-item label="选择地址" prop="latitude" :rules="{ required: true, message: '选择地址 不能为空'}">
                        <el-button @click="selectAddressMap()">选择地址</el-button>
                        {{ form.province }}{{ form.city }}{{ form.district }}
                    </el-form-item>

                    <el-form-item label="详细地址" prop="address" :rules="{ required: true, message: '详细地址 不能为空'}">
                        <el-input v-model="form.address"></el-input>
                    </el-form-item>

                </LayoutCellItem>

                <LayoutCellItem title="营业时间">
                    <el-form-item label="营业时间" prop="operate_list" :rules="{ required: true, message: '营业时间 不能为空'}">
                        <SelectDateCycleApplication :appWindow="appWindow" v-model="form.operate_list">
                        </SelectDateCycleApplication>
                    </el-form-item>
                    <el-form-item label="营业状态" prop="operate_status">
                        <el-radio-group v-model="form.operate_status">
                            <el-radio :label="0">休息中</el-radio>
                            <el-radio :label="1">营业中</el-radio>
                        </el-radio-group>
                    </el-form-item>
                </LayoutCellItem>

                <LayoutCellItem title="有效期设置">
                    <el-form-item label="有效期设置" prop="validity_type">
                        <el-radio-group v-model="form.validity_type" :disabled="form.key">
                            <el-radio :label="1">指定天数</el-radio>
                            <el-radio :label="2">指定时间段</el-radio>
                            <el-radio :label="3">无限期</el-radio>
                        </el-radio-group>
                    </el-form-item>
                    <div v-if="form.validity_type != 3">
                        <el-form-item label="设置过期天数" v-if="form.validity_type == 1">
                            <el-input v-model="form.validity_days"></el-input>
                        </el-form-item>
                        <el-form-item label="设置过期时间" v-if="form.validity_type == 2 || form.validity_type == 3">
                            <!-- {{ form.validity_end }} -->
                            <el-date-picker v-model="form.validity_end" type="datetime"
                                value-format="yyyy-MM-dd HH:mm:ss" placeholder="选择时间">
                            </el-date-picker>
                        </el-form-item>
                    </div>
                </LayoutCellItem>

                <LayoutCellItem title="账号密码设置">
                    <el-form-item label="门店账号" prop="username" :rules="{ required: true, message: '门店账号 不能为空'}">
                        <el-input v-model="form.username"></el-input>
                    </el-form-item>
                 
                    <el-form-item label="密码" prop="password" :rules="[{ required: mixinEdit_editType != 'update', trigger: ['blur', 'change'] , validator: $vFN.Tools.validatePassword}]">
                        <el-input v-model="form.password" maxlength="20" show-password></el-input>
                        <span v-show="mixinEdit_editType == 'update'" class="secondary">密码传空默认为不修改</span>
                    </el-form-item>
                </LayoutCellItem>

                <LayoutCellItem title="结算设置">
                    <el-form-item label="平台抽佣" prop="cost_ratio" :rules="[{ required: true, trigger: ['blur', 'change'],validator:function(rule, value, callback){validatorNumber(rule, value, callback)}}]">
                        <el-input style="width: 200px;" v-model="form.cost_ratio"></el-input>%
                    </el-form-item>
                    <el-form-item label="结算天数" prop="cost_days" :rules="{ required: true, message: '结算天数 不能为空'}">
                        发放时间延迟 <el-input style="width: 200px;" v-model="form.cost_days"></el-input> 天
                    </el-form-item>
                </LayoutCellItem>

                <LayoutCellItem title="配送设置">
                    <!-- <el-form-item label="配送方式" prop="send_offline">
                        <el-radio-group v-model="form.send_offline">
                            <el-radio :label="1">到店自提</el-radio>
                        </el-radio-group>
                    </el-form-item>
                    <el-form-item label="" prop="send_online">
                        <el-radio-group v-model="form.send_online">
                            <el-radio :label="1">快递配送</el-radio>
                        </el-radio-group>
                    </el-form-item> -->

                    <el-form-item label="配送方式" prop="send_online">
                        <el-checkbox v-model="form.send_online" :true-label="1" :false-label="0">快递配送</el-checkbox>
                    </el-form-item>
                    <el-form-item label="" prop="send_offline">
                        <el-checkbox v-model="form.send_offline" :true-label="1" :false-label="0">到店自提</el-checkbox>
                    </el-form-item>

                    <el-form-item label="自提地址" prop="offline_type" :rules="{ required: true, message: '自提地址 不能为空'}">
                        <el-radio-group v-model="form.offline_type">
                            <el-radio :label="1">本店地址</el-radio>
                            <el-radio :label="2">其他地址</el-radio>
                        </el-radio-group>
                    </el-form-item>
                    <el-form-item label="地址" prop="offline_address" v-show="form.offline_type == 2">
                        <el-input v-model="form.offline_address"></el-input>
                    </el-form-item>
                </LayoutCellItem>
            </LayoutCell>
        </el-form>
    </div>
    <div slot="footer">
        <el-row>
            <el-col :span="12" style="text-align: left;">
                <el-button @click="mixinEdit_resetForm('editForm')">重 置</el-button>
            </el-col>
            <el-col :span="12">
                <el-button @click="mixinEdit_editBoxClose('editForm')">取 消</el-button>
                <el-button type="primary" @click="mixinEdit_editFormSubmit({model:'form',ref:'editForm'})"
                    :disabled="mixinEdit_loading">确
                    定</el-button>
            </el-col>
        </el-row>
    </div>
</el-dialog>